﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YasharEl.Infrastructure.ApplicationModel.Modularity;
using YasharEl.Infrastructure.ApplicationModel.Modularity.Bootstrap;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensibility;
using YasharEl.Infrastructure.Diagnostics.Logging;
using YasharEl.Infrastructure.ApplicationModel.Bootstrap.Extensions;

namespace BneyBaruch.Technology.SourcesRepository.ApplicationModel
{
    public class SourcesRepositoryModule : BaseModule
    {
        protected override BaseModuleBootstrapper<IModuleComponentBootstrappingExtension> CreateModuleBootstrapper()
        {
            return new BaseModuleBootstrapper<IModuleComponentBootstrappingExtension>(
                ModuleContainer,
                ModuleContainer.DependencyResolver.Resolve<ILogger<BaseModuleBootstrapper<IModuleComponentBootstrappingExtension>>>()
            );
        }

        protected override IEnumerable<IComplexBootstrappingExtension> EnumerateModuleComponents()
        {
            return new List<IComplexBootstrappingExtension>(
                new IComplexBootstrappingExtension[] 
                {
                    new ObjectFactoryBootstrapperExtension(),
                    new LoggingBootstrapperExtension(),
                    new ExceptionHandlingBootstrapperExtension()
                });
        }
    }
}
